package main.java.study.step01;

import java.util.Arrays;

/**
 * @author liuwenxiu
 * @Description: 数组相关
 * @date 2022-7-11 17:41
 */
public class ArrayDemo {
    public static void main(String[] args) {
        int[] arr = {1, 3, 5, 7, 9};
        // 通过普通for循环
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+"\t");
        }
        System.out.println("\n------------------");
        // 增强型for循环
        for (int i : arr) {
            System.out.print(i+"\t");
        }
        System.out.println("\n------------------");
        // 工具类
        System.out.println(Arrays.toString(arr));
    }
}
